//
//  MFinishedTask.m
//  RRQS
//
//  Created by kyjun on 16/3/30.
//
//

#import "MFinishedTask.h"

@implementation MFinishedTask

-(instancetype)initWithItem:(NSDictionary *)item{
    self = [super init];
    if(self){
        _date = [item objectForKey:@"date"];
        _count = [item objectForKey:@"count"];
        NSArray* array = [item objectForKey:@"orders"];
        if(![WMHelper isNULLOrnil:array]){
            [array enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                MOrder* sub = [[MOrder alloc]initWithFished:obj];
                [self.arrayOrder addObject:sub];
            }];
        }

    }
    return self;
}

-(NSMutableArray *)arrayOrder{
    if(!_arrayOrder){
        _arrayOrder = [[NSMutableArray alloc]init];
    }
    return _arrayOrder;
}

@end
